package cn.tedu.account.tcc;

import io.seata.rm.tcc.api.BusinessActionContext;
import io.seata.rm.tcc.api.BusinessActionContextParameter;
import io.seata.rm.tcc.api.LocalTCC;
import io.seata.rm.tcc.api.TwoPhaseBusinessAction;

import java.math.BigDecimal;

/**
 * @ClassName AccountTccAction
 * @Description:类描述
 * @Author Tedu
 * @Date 2021/7/5 10:31
 * @Version V1.0
 **/
@LocalTCC
public interface AccountTccAction {
    @TwoPhaseBusinessAction(name="AccountTccAction")
    boolean prepare(
            BusinessActionContext ctx,
           @BusinessActionContextParameter(paramName = "userId") Long userId,
           @BusinessActionContextParameter(paramName = "money") BigDecimal money
    );
    boolean commit(BusinessActionContext ctx);
    boolean rollback(BusinessActionContext ctx);
}
